package com.lineage.server.serverpackets;

public class S_ItemCount extends ServerBasePacket {
  private byte[] _byte;
  
  public S_ItemCount(int objId, int max, String cmd) {
    this._byte = null;
    writeC(136);
    writeD(objId);
    writeD(0);
    writeD(0);
    writeD(0);
    writeD(max);
    writeH(0);
    writeS("request");
    writeS(cmd);
  }
  
  public S_ItemCount(int objId, int max, String html, String cmd) {
    this._byte = null;
    writeC(136);
    writeD(objId);
    writeD(0);
    writeD(0);
    writeD(0);
    writeD(max);
    writeH(0);
    writeS(html);
    writeS(cmd);
  }
  
  public S_ItemCount(int objId, int min, int max, String html, String cmd, String[] data) {
    this._byte = null;
    writeC(136);
    writeD(objId);
    writeD(0);
    writeD(min);
    writeD(min);
    writeD(max);
    writeH(0);
    writeS(html);
    writeS(cmd);
    if (data != null && 1 <= data.length) {
      writeH(data.length);
      int length = data.length;
      int i = 0;
      while (i < length) {
        String datum = data[i];
        writeS(datum);
        i++;
      } 
    } 
  }
  
  public S_ItemCount(int objId, int min, int max, String html, String cmd) {
    this._byte = null;
    writeC(136);
    writeD(objId);
    writeD(0);
    writeD(min);
    writeD(min);
    writeD(max);
    writeH(0);
    writeS(html);
    writeS(cmd);
  }
  
  public byte[] getContent() {
    if (this._byte == null)
      this._byte = getBytes(); 
    return this._byte;
  }
  
  public String getType() {
    return getClass().getSimpleName();
  }
}
